package com.ym.domain.model;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.gitee.sunchenbin.mybatis.actable.annotation.ColumnComment;
import com.gitee.sunchenbin.mybatis.actable.annotation.ColumnType;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsKey;
import com.gitee.sunchenbin.mybatis.actable.annotation.TableComment;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@Table
@TableComment("一口价订单详情表")
public class OdBuyItNowDetail {

    @TableId(type = IdType.ASSIGN_ID)
    @IsKey
    @Column
    @ColumnComment("主键ID")
    private Long id;

    @Column
    @ColumnComment("订单ID")
    private Long orderId;

    @Column
    @ColumnComment("域名ID")
    private Long domainId;

    @Column(length = 255)
    @ColumnComment("域名")
    private String domainName;

    @Column
    @ColumnComment("购买状态。0-购买中，1-购买成功，2-购买失败，3-取消交易")
    private Short buyStatus;

    @Column
    @ColumnComment("退款状态。0-无需退款，1-退款成功")
    private Short refundStatus;

    @Column
    @ColumnType(value = MySqlTypeConstant.DECIMAL, length = 18, decimalLength = 2)
    @ColumnComment("域名订单价格")
    private BigDecimal domainPrice;

    @Column
    @ColumnType(value = MySqlTypeConstant.DECIMAL, length = 18, decimalLength = 2)
    @ColumnComment("域名成本（第三方平台价格）")
    private BigDecimal domainCost;

    @Column
    @ColumnType(value = MySqlTypeConstant.DECIMAL, length = 18, decimalLength = 2)
    @ColumnComment("域名利润（第三方平台利润）")
    private BigDecimal domainProfit;

    @Column(length = 255)
    @ColumnComment("第三方平台订单号")
    private String outOrderNo;

    @Column
    @ColumnType(value = MySqlTypeConstant.TEXT)
    @ColumnComment("域名快照")
    private String domainSnapshot;


    @Column
    @ColumnComment("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @Column
    @ColumnComment("修改时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime updateTime;

}
